package entities;

import java.io.Serializable;

/**
 *
 * @author hxl851
 */
public class Property implements Serializable {

    private int playerID;
    private int type;
    private int x, y;
    private int currentHealth;
    private boolean alive;
    private String msg1;
    private String msg2;

    public Property(int playerID, int type, int x, int y, int currentHealth, boolean alive) {
        this.playerID = playerID;
        this.type = type;
        this.x = x;
        this.y = y;
        this.currentHealth = currentHealth;
        this.alive = alive;
        this.msg1 = null;
        this.msg2 = null;
    }

    public Property(Property property) {
        this.playerID = property.getPlayerID();
        this.type = property.getType();
        this.x = property.getX();
        this.y = property.getY();
        this.currentHealth = property.getCurrentHealth();
        this.alive = property.isAlive();
        this.msg1 = property.getMsg1();
        this.msg2 = property.getMsg2();
    }

    public boolean isAlive() {
        return alive;
    }

    public int getCurrentHealth() {
        return currentHealth;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setPlayerID(int playerID) {
        this.playerID = playerID;
    }

    public int getPlayerID() {
        return playerID;
    }

    public String getMsg1() {
        return msg1;
    }

    public void setMsg1(String msg) {
        if (msg != null) {
            this.msg1 = new String(msg);
        } else {
            this.msg1 = null;
        }
    }

    public String getMsg2() {
        return msg2;
    }

    public void setMsg2(String msg) {
        if (msg != null) {
            this.msg2 = new String(msg);
        } else {
            this.msg2 = null;
        }
    }
}
